package com.hymjweb.demo.hymj.finance_manage.repayment.detail.mapper;

import com.hymjweb.demo.hymj.finance_manage.repayment.detail.bean.CwRepaymentDetailPojo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface CwRepaymentDetailMapper {

    class CwRepaymentDetailMapperProvider{

    }

    @Insert(
            "<script>" +
                    "insert into cw_repayment_detail(id, native_bill_id, settlement_amount, repayment_id, comment, create_time, create_user_id, update_time, update_user_id) values " +
                    "<foreach collection='detailPojoList' item='pojo' separator=','>" +
                    "(#{pojo.id},#{pojo.nativeBillId},#{pojo.settlementAmount},#{pojo.repaymentId},#{pojo.comment},#{pojo.createTime},#{pojo.createUserId},#{pojo.updateTime},#{pojo.updateUserId})" +
                    "</foreach>" +
            "</script>"
    )
    @Options(keyProperty = "id")
    int batchInsert(@Param("detailPojoList") List<CwRepaymentDetailPojo> detailPojoList);




}
